package com.ftt.customer.service;

import com.ftt.customer.dao.CustomerDao;
import com.ftt.customer.model.Customer;

public class CustomerService {
    //根据账号密码返回信息
    public Customer login(String username, String password) {
        CustomerDao dao = new CustomerDao();
        //改错1：传参
        Customer customer = dao.getCustomerByName(username);
        if (customer !=null) {
            //改错2：传参
            if (username.equals(customer.getUser_name()) && password.equals(customer.getPassword())) {
                return customer;
            }
        }
        return null;
    }

}
